package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserDayNumber;
import com.culturalCenter.dataCenter.mapper.user.UserDayNumberMapper;
import com.culturalCenter.dataCenter.service.user.UserDayNumberService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserDayNumber业务层接口实现类
 * @Date
 *****/
@Service
public class UserDayNumberServiceImpl implements UserDayNumberService {

    @Resource
    private UserDayNumberMapper userDayNumberMapper;

    @Override
    public PageInfo<UserDayNumber> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userDayNumberMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userDayNumberMapper.deleteById(id);
    }

    @Override
    public Integer update(UserDayNumber userDayNumber) {
        return userDayNumberMapper.update(userDayNumber);
    }

    @Override
    public Integer add(UserDayNumber userDayNumber) {
        return userDayNumberMapper.insert(userDayNumber);
    }

    @Override
    public UserDayNumber findById(String id) {
        return userDayNumberMapper.queryById(id);
    }

    @Override
    public List<UserDayNumber> findAll(UserDayNumber userDayNumber) {
        return (List<UserDayNumber>) userDayNumberMapper.queryAll(userDayNumber);
    }

}
